﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PayTypeManager.aspx.cs" Inherits="PayTypeManager"  Theme="DefaultSkin" %>
<%@ Register src="Navigate.ascx" tagname="Navigate" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>支付类型</title>
    <script src="JS/jquery.min.js" language="javascript"></script>
    <script>
        function SelectTreeNode(payTypeID)
        {
            //所有分类不能被删除
            if( payTypeID !=-1)
            {
                 $('#btnDel').show();
            }
            else
            {
                 $('#btnDel').hide();
            }
        
           document.getElementById('hdnSelectValue').value = payTypeID;
           
                  
           $.getJSON("PayTypeManager.aspx?AjaxType=1&PayTypeID="+payTypeID +"&Time=" + new Date().getTime(), function(data){
                  document.getElementById('txtEditFinaceType').value = data.TypeName;
                  document.getElementById('txtEditRemark').value = data.Remark;
                  
            }); 
        }
    
        function CheckSubmit()
        {
            if(document.getElementById('hdnSelectValue').value == '')
            {
                alert('请在左边的树中选择收支分类');
                return false;
            }
            
            if(document.getElementById('txtPayType').value == '' )
            {
                alert('请填写收支类型');
                return false;
            }
            
            return true;
        }
    </script>
</head>
<body style="text-align:center;">
    <form id="form1" runat="server">
    
    <asp:HiddenField ID="hdnSelectValue" runat="server" />
    
    <uc1:Navigate ID="Navigate1" runat="server" />

    <table cellpadding="0" cellspacing="0" width="width:980px" >
    <tr>
        <td style="width:150px;text-align:left;">
            <iframe src="PayTypeTree.aspx?CallBack=SelectTreeNode" frameborder="no" width="150px" height="500px"></iframe>
        </td>
        <td style="padding:0px" valign="top" align="left">
        
            <table  cellpadding="0" border="0"  style="width:99%;padding-left:15px;margin-top:15px">
            <tr>
                <td><b>分类</b>:<asp:TextBox ID="txtEditFinaceType" runat="server"></asp:TextBox></td>
            </tr>
            <tr style="line-height:28px">
               <td><b>备注</b>:<asp:TextBox ID="txtEditRemark" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
               <td colspan="2" style="display:inline;width:800px;padding-top:20px;padding-left:20px">
                    <table cellpadding="0"  cellspacing="0" style="width:120px;height:33px">
                    <tr>
                         <td><asp:Button ID="btnSave" runat="server" Text="保 存" onclick="btnSave_Click"    /> </td>
                         <td><asp:Button ID="btnDel" runat="server" Text="删 除" onclick="btnDel_Click"  OnClientClick="return confirm('确认删除吗?');" /></td>
                    </tr>
                    </table>
               </td>
            </tr>
            </table>

            <table cellpadding="0" cellspacing="0"  border="0" style="margin-top:18px;background:lavender;width:830px">
            <tr style="line-height:2px;">
                <td>&nbsp;</td>
            </tr>
            </table>
            <br />
            
             <table id="tblAddFinaceType"  runat="server"  cellpadding="0" cellspacing="0" border="0" align="center"  >
                <tr style="line-height:25px">
                 <td>
                    收支类型&nbsp;&nbsp;
                 </td>
                 <td>
                     <asp:TextBox ID="txtPayType" runat="server"></asp:TextBox>
                 </td>
                </tr>
                <tr style="line-height:30px">
                <td>
                    备注
                </td>
                <td>
                    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine"></asp:TextBox>
                </td>
                </tr>
                <tr style="line-height:30px">
                <td colspan="2" align="center">
                     <asp:Button ID="btnAdd" runat="server" Text="添加类型" CssClass="ButtonBlue7" onclick="btnAdd_Click" OnClientClick="return CheckSubmit();"/>
                </td>
                </tr>
                </table>
        </td>
    </tr>
    </table>
    

      <%-- <asp:GridView ID="gdvShow" runat="server" AutoGenerateColumns="False" 
            Width="450px" onrowdeleting="gdvShow_RowDeleting" >
       <Columns>
            <asp:BoundField DataField="TypeName" HeaderText="支付类型" />
            <asp:BoundField DataField="Remark" HeaderText="备注" />
            <asp:ButtonField CommandName="Delete" Text="删除" />
            
       </Columns>
       </asp:GridView>--%>
       

        
    
        

    </form>
</body>
</html>
